package com.ehotting.edsta.circuitDesign.bean;

import java.util.List;

public class UDriveContrastBean {
    private Data data;
    private boolean success;
    private int errorCode;
    private String message;
    public void setData(Data data) {
        this.data = data;
    }
    public Data getData() {
        return data;
    }
    public void setSuccess(boolean success) {
        this.success = success;
    }
    public boolean getSuccess() {
        return success;
    }
    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }
    public int getErrorCode() {
        return errorCode;
    }
    public void setMessage(String message) {
        this.message = message;
    }
    public String getMessage() {
        return message;
    }

    public static class ChipInfo {

        private String model;
        private int chipId;
        private String manufacturer;
        public void setModel(String model) {
            this.model = model;
        }
        public String getModel() {
            return model;
        }

        public void setChipId(int chipId) {
            this.chipId = chipId;
        }
        public int getChipId() {
            return chipId;
        }

        public void setManufacturer(String manufacturer) {
            this.manufacturer = manufacturer;
        }
        public String getManufacturer() {
            return manufacturer;
        }

    }

    public static class ChipDriverMatrix {

        private List<Integer> supportSlaveChipId;
        private List<Integer> unSupportSlaveChipId;
        private int masterChipId;
        public void setSupportSlaveChipId(List<Integer> supportSlaveChipId) {
            this.supportSlaveChipId = supportSlaveChipId;
        }
        public List<Integer> getSupportSlaveChipId() {
            return supportSlaveChipId;
        }

        public void setUnSupportSlaveChipId(List<Integer> unSupportSlaveChipId) {
            this.unSupportSlaveChipId = unSupportSlaveChipId;
        }
        public List<Integer> getUnSupportSlaveChipId() {
            return unSupportSlaveChipId;
        }

        public void setMasterChipId(int masterChipId) {
            this.masterChipId = masterChipId;
        }
        public int getMasterChipId() {
            return masterChipId;
        }

    }

    public static class Data {

        private List<ChipInfo> chipInfoList;
        private List<ChipDriverMatrix> chipDriverMatrixList;
        public void setChipInfoList(List<ChipInfo> chipInfoList) {
            this.chipInfoList = chipInfoList;
        }
        public List<ChipInfo> getChipInfoList() {
            return chipInfoList;
        }

        public void setChipDriverMatrix(List<ChipDriverMatrix> chipDriverMatrixList) {
            this.chipDriverMatrixList = chipDriverMatrixList;
        }
        public List<ChipDriverMatrix> getChipDriverMatrix() {
            return chipDriverMatrixList;
        }

        public ChipInfo getChipInfoByModel(String model){
            if(model != null){
                for(ChipInfo c : this.chipInfoList){
                    if(model.contains(c.model)){
                        return c;
                    }
                }
            }
            return null;
        }

        public ChipDriverMatrix getchipDriverMatrixByMasterChipId(int masterChipId){
            for(ChipDriverMatrix c : this.chipDriverMatrixList){
                if(masterChipId == c.masterChipId){
                    return c;
                }
            }
            return null;
        }
    }
}

